﻿
// opencv_demo1.h: PROJECT_NAME 应用程序的主头文件
//

#pragma once

#include <opencv2\opencv.hpp>
#include <opencv2/highgui.hpp>
#include <opencv2/core.hpp>
#include <opencv2\imgproc\types_c.h>
#include <opencv2/imgcodecs.hpp>

#include <Windows.h>

class opencv_screenshot
{
public:
	void start();

	static void S_on_Mouse_cb(int event, int x, int y, int flags, void* param);
	void S_on_Mouse(int event, int x, int y, int flags);

	cv::Rect select;
	bool select_flag = false;
	cv::Mat m_origImg, showImg;

	//窗口获取
	double static getZoom();
	cv::Mat getScreenshot();
	cv::Mat getScreenshot(int x, int y, int width, int height);

	int m_width;
	int m_height;
	HDC m_screenDC;
	HDC m_compatibleDC;
	HBITMAP m_hBitmap;
	LPVOID m_screenshotData = nullptr;
};
